<template>
  <div>
    <el-form :model="formItem" label-width="100px" size="mini" class="form-view">
      <el-row>
        <el-col :span="24">
          <el-form-item label="审批结果" prop="result">
            {{ formItem.result === '1' ? '同意' : '不同意' }}
          </el-form-item>
        </el-col>
      </el-row>
    </el-form>
  </div>
</template>
<script>
import { detail } from '@neu/dcam-ui/api/itsm'

export default {
  props: {
    taskId: {
      required: false,
      type: String,
      default: 'NULL'
    },
    workOrderNum: {
      required: false,
      type: String,
      default: ''
    },
    type: {
      required: false,
      type: String,
      default: ''
    }
  },
  data() {
    return {
      formItem: {
        result: ''
      }
    }
  },
  created() {
    this.fetch()
  },
  methods: {
    // 获取ITSM审批意见
    fetch() {
      if (this.workOrderNum !== 'NULL') {
        detail(this.type, this.workOrderNum, this.taskId).then(response => {
          this.formItem = {
            ...response.data
          }
        })
      }
    }
  }
}
</script>
